package handin03;

import java.util.Scanner;

/**
 * HoroscopeTesteer test the classes of the horoscope project
 * @author Peter Tolstrup Aagesen
 *
 */

public class HoroscopeTester {

	public static void main(String[] args) {
		//Create new Scanner
		Scanner input = new Scanner(System.in);
		
		//Create Horoscope and HoroscopeFrame object
		Horoscope horoscope = new Horoscope();
		HoroscopeFrame horoscopeFrame = new HoroscopeFrame();
		
		//Get user input
		System.out.println("Please enter you birth day.");		
		System.out.println("Enter month:");
		int month = input.nextInt();	//Create a variable for month and set value
		System.out.println("Enter day:");
		int day = input.nextInt();	//Create variable for day and set value
		
		//Test if the input is valid
		while (!Horoscope.isValidBirthDay(month, day)) //Keep asking for valid input
		{
			System.out.println("You failed to supply a valid birthday. Please try again.");
			System.out.println("Enter month:");
			month = input.nextInt(); //Set new value
			System.out.println("Enter day:");	
			day = input.nextInt();	//Set new value
		}	
		
		//Set the sign
		horoscope.setSign(month, day);	
		//Display horoscope
		horoscopeFrame.showHoroscope(horoscope.getSignInfo(), 
				horoscope.getWeek(), 
				horoscope.getHoroscope());			
	}

}
